using EarthGeospatial;

namespace Cesium3DTilesSelection
{


    public class Impl
    {

        public static GlobeRectangle obtainGlobeRectangle(BoundingVolume pBoundingVolume)
        {
            if (pBoundingVolume.pBoundingRegion)
            {
                return pBoundingVolume.pBoundingRegion.getRectangle();
            }
            if (pBoundingVolume.pLooseRegion)
            {
               return  pBoundingVolume.pLooseRegion.getBoundingRegion().getRectangle();
            }
            return null;
        }

        public static double  calcQuadtreeMaxGeometricError(Ellipsoid ellipsoid)
        {
            double mapQuality = 0.25;
            int mapWidth = 65;
            return ellipsoid.getMaximumRadius() * mapQuality / mapWidth;
        }
    }
}